package one;
import java.util.Arrays;

public class Array {
    public static int[] testArray(int len,int max) {
        int[] arr = new int[len];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * (max + 1));
        }
        return arr;

    }

    public static void main(String[] args) {
        int[] a = testArray(6, 10);
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);

        }
        System.out.println("------");
        int[] b = Arrays.copyOf(a, 10);
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);

        }
        System.out.println("------");
        int[] c = new int[10];
        System.arraycopy(a, 1, c, 0, 5);
        for (int i = 0; i < c.length; i++) {
            System.out.println(c[i]);
        }
    }
}
